import React, { Component } from 'react';
import { Select, Switch } from 'antd';

const { Option } = Select;

class CheckBoxComp extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    let tmpType = this.props.compSetting['_type'];
    let isFilter = false;
    if (-1 !== tmpType.indexOf('_FILTER')) {
      isFilter = true;
      tmpType = tmpType.substr(0, tmpType.indexOf('_FILTER'));
    }
    if (isFilter) {
      return (
        <Select defaultValue="">
          <Option value="">请选择</Option>
          <Option value="1">是</Option>
          <Option value="0">否</Option>
        </Select>
      );
    } else {
      return <Switch checkedChildren="是" unCheckedChildren="否"/>;
    }
  }
}

export default CheckBoxComp;
